how to transform from a detached to a persistent state